package com.mihoyo.basic;

import com.mihoyo.domain.Store;
import com.mihoyo.service.StoreService;
import com.mihoyo.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class StoreFeignClientFallbackFactory implements FallbackFactory<StoreService> {
    @Override
    public StoreService create(Throwable throwable) {
        return new StoreService() {
            @Override
            public AjaxResult addStore(Store store) {
                AjaxResult ajaxResult = AjaxResult.me();
                ajaxResult.setSuccess(false);
                ajaxResult.setMessage("添加失败");
                return ajaxResult;
            }
        };
    }
}
